package fengstyle.order;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {

    @Autowired
    private OrderService service;

    @GetMapping("/order/add")
    public void addOrder(Integer id, String no, String userName){
        Order order = new Order();
        order.setId(id);
        order.setNo(no);
        order.setUserName(userName);
        service.addOrder(order);
    }

    @GetMapping("/order/addException")
    public void addOrderException(Integer id, String no, String userName){
        Order order = new Order();
        order.setId(id);
        order.setNo(no);
        order.setUserName(userName);
        service.addOrderException(order);
    }

}
